Introduction to spatial transcriptomics

Konstantin Zaitsev

March 22, 2023

Spatial Transcriptomics

Spatial Transcriptomics

  • Quantification of mRNA expression of (numbers of) genes within the spatial context of tissues / organs
  • The first attempts can be dated to 1970s

Spatial Transcriptomics

Spatial Transcriptomics

Spatial Transcriptomics

Spatial Transcriptomics

Current-era technologies

  • Region of interest (RoI) selection
  • Single-molecule FISH (smFISH)
  • In situ sequencing
  • Next-generation sequencing with spatial barcoding
  • methods not requiring a priori spatial locations

Spatial Transcriptomics

Current-era technologies

  • Region of interest (RoI) selection
  • Single-molecule FISH (smFISH)
  • In situ sequencing
  • Next-generation sequencing with spatial barcoding
  • methods not requiring a priori spatial locations

The ancestor of visium

The ancestor of visium

The ancestor of visium

The precursor of Visium

https://www.science.org/doi/10.1126/science.aaf2403

Similarity with scRNA-seq

Due to the similarity in the nature of the data with scRNA-seq:

  • Most of the ecosystems (Seurat or SCANPY in pyhon) suited for scRNA-seq will be OK for spatial transcriptomics
  • Most of the analysis steps are similar (normalization, PCA and clustering)
  • In fact we will use Seurat in this class

Different size - different problems

  • Micrometer = μm = micron = \(1 \times 10^{-6}\) metre
  • Most bacteria are 0.2 micron in diameter and 2−8 micron in length
  • Mitochondria - 0.5 - 1 micron
  • Lymphocyte size - 8–10 microns in diameter
  • Visium spot size - 50 micron

What are the new problems that need solving - deconvolution

What are the new problems that need solving - identification of spatially variable genes

Data for today - lymph node

  • A lymph node is an organ of the lymphatic system and the adaptive immune system
  • Germinal centers(GCs) are transiently formed structures within B cell zone (follicles) in lymph nodes
  • B cells are activated, proliferate, differentiate, and mutate their antibody genes in GCs

Data for today - germinal center

  • B cells are activated, proliferate, differentiate, and mutate their antibody genes in GCs
  • “Naive B cells do not undergo lots of cell division. On the other hand, B cells in GC B cells tend to divide rapidly and frequently, and they can have cell cycles as short as only five hours.”

Data for today - lymph node

We will try to identify

  • Germinal centers
  • T cells zones
  • B cells zones
  • Plasma cells?
  • Trabecula?

The dataset - human lymph (VISIUM)

The dataset - human lymph - summary

Loading the libraries

library(Seurat)
library(SeuratData)
library(ggplot2)
library(patchwork)
library(dplyr)

Load the data

lymph_node <- Load10X_Spatial(data.dir = ".", filename = "spatial/V1_Human_Lymph_Node_filtered_feature_bc_matrix.h5")
lymph_node
## An object of class Seurat 
## 36601 features across 4035 samples within 1 assay 
## Active assay: Spatial (36601 features, 0 variable features)
##  1 image present: slice1

QC

VlnPlot(lymph_node, features = "nCount_Spatial", pt.size = 0.1) + NoLegend()
SpatialFeaturePlot(lymph_node, features = "nCount_Spatial") + theme(legend.position = "right")

Normalization

  • We will utilize SCTransform again
lymph_node <- SCTransform(lymph_node, assay = "Spatial", verbose = FALSE)

Known markers - Proliferation

SpatialFeaturePlot(lymph_node, features = c("MKI67", "TUBB"), alpha = c(0.1, 1))

Known markers - T cells

SpatialFeaturePlot(lymph_node, features = c("CD3D", "IL7R"), alpha = c(0.1, 1))

Known markers - B cells

SpatialFeaturePlot(lymph_node, features = c("CD19", "MS4A1", "CD21"), alpha = c(0.1, 1))

Lymph node - clustering analysis

lymph_node <- RunPCA(lymph_node, assay = "SCT", verbose = FALSE)
lymph_node <- FindNeighbors(lymph_node, reduction = "pca", dims = 1:30)
lymph_node <- FindClusters(lymph_node, verbose = FALSE)
lymph_node <- RunUMAP(lymph_node, reduction = "pca", dims = 1:30)

Notion about UMAP

  • Since the spots do not represent pure cells types the expression patterns are mixtures of different cell types
  • I would recommend against using UMAP in this scenarios - histology image is better visual clue for you

Lymph node - identified clusters

DimPlot(lymph_node, reduction = "umap")
SpatialDimPlot(lymph_node, label = TRUE, label.size = 3)

Lymph node - identified clusters

SpatialPlot(lymph_node, pt.size.factor = 0.6)
SpatialDimPlot(lymph_node, label = TRUE, label.size = 3)

Differential expression

de_markers <- FindAllMarkers(lymph_node, only.pos = T)
head(de_markers)
##                p_val avg_log2FC pct.1 pct.2     p_val_adj cluster   gene
## CCL21  9.472831e-114  0.4699865 1.000 1.000 2.014019e-109       0  CCL21
## CCL2    1.570773e-84  0.5363093 0.999 0.961  3.339620e-80       0   CCL2
## C7      3.203259e-49  0.3513696 0.993 0.952  6.810449e-45       0     C7
## JCHAIN  2.822487e-47  0.2504207 1.000 1.000  6.000889e-43       0 JCHAIN
## CEBPD   4.478532e-47  0.3927098 0.965 0.875  9.521807e-43       0  CEBPD
## IGHA1   6.160128e-45  0.3404398 1.000 1.000  1.309705e-40       0  IGHA1

Good markers: cluster 0

goodMarkers <- de_markers %>% filter(cluster == 0) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(0)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Good markers: cluster 1

goodMarkers <- de_markers %>% filter(cluster == 1) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(1)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Checking the expression with the reference

Good markers: cluster 2

goodMarkers <- de_markers %>% filter(cluster == 2) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(2)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Good markers: cluster 3

goodMarkers <- de_markers %>% filter(cluster == 3) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(3)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Good markers: cluster 4

goodMarkers <- de_markers %>% filter(cluster == 4) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(4)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Good markers: cluster 5

goodMarkers <- de_markers %>% filter(cluster == 5) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(5)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Good markers: cluster 6

goodMarkers <- de_markers %>% filter(cluster == 6) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(6)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Good markers: cluster 7

goodMarkers <- de_markers %>% filter(cluster == 7) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(7)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Good markers: cluster 8

goodMarkers <- de_markers %>% filter(cluster == 8) %>% slice_min(order_by = p_val_adj, n = 4) %>% pull(gene)
SpatialDimPlot(lymph_node, cells.highlight = CellsByIdentities(object = lymph_node, idents = c(8)), facet.highlight = TRUE)
SpatialFeaturePlot(object = lymph_node, features = goodMarkers, alpha = c(0.1, 1), ncol = 2)

Annotation results

  • Cluster 0 - some B cells
  • Cluster 1 - some other B cells
  • Cluster 2 - germinal centers
  • Cluster 3 - B plasma cells (?)
  • Cluster 4 - T cell zone
  • Cluster 5 - are these cells dying (?)
  • Cluster 6 - ??
  • Cluster 7 - ?
  • Cluster 8 - IFN stimulated region

Finding spatially variable genes

lymph_node <- FindSpatiallyVariableFeatures(lymph_node, assay = "SCT", features = VariableFeatures(lymph_node)[1:1000], selection.method = "moransi")

Visualizing the features

SpatialFeaturePlot(lymph_node, features = head(SpatiallyVariableFeatures(lymph_node, selection.method = "moransi"), 6), ncol = 3, alpha = c(0.1, 1), max.cutoff = "q95")

Spatial Transcriptomics

  • Tissue context can be evaluated better using Spatial Transcriptomics
  • While the field in general is relatively novel, methods have been developed since 70s
  • Most of the scRNA-seq ecosystems support spatial transcriptomics

Question?